There is a known approach to improving the reliability of an integrated circuit by embedding a fault diagnosis circuit that detects a fault in the integrated circuit and causing the fault diagnosis circuit to operate to detect a fault in the integrated circuit in operation. One example is a BIST (Built-In-Self-Test) mechanism.
For example, an integrated circuit having a diagnosis circuit for a logic circuit has been proposed. The integrated circuit includes a register which holds an internal state of the logic circuit and a restoration circuit which inputs the internal state held in the register into the logic circuit, and switches between a normal operation and a diagnosis operation. The integrated circuit continues a diagnosis operation while responding to access from another circuit, or discontinues the diagnosis operation and returns the circuit to the state it was in before the diagnosis operation. (See for example Japanese Laid-Open Patent Publication No. 2006-300650.)
Scan flip-flop circuits capable of scan testing are also known. For example, a scan flip-flop circuit has been proposed in which a latch circuit of a cell in a master stage is disconnected from a latch circuit of a cell in a slave stage at the time scan data is set, thereby preventing the set scan data from being output. (See for example Japanese Laid-Open Patent Publications No. H7-198787 and No. 2007-78689.)
The fault diagnosis described above is performed while the integrated circuit holds the input data before the fault diagnosis, and when the integrated circuit is switched from the fault diagnosis operation to the normal operation, the held data is used to return the integrated circuit to the state it was in before the fault diagnosis. However, the transition from the fault diagnosis operation to the normal operation in the existing techniques is not straightforward. For example, when the integrated circuit is returned from the fault diagnosis operation to the normal operation, an extra process for writing the held data into a circuit in the integrated circuit is performed.